package cn.jack.javalib.player;

/**
 * Created by chengyinggen on 2019/2/26.
 */
public class VideoPlayer extends IPlayer {

    private PlayerState mState;

    public VideoPlayer() {
        mState = new StopPlay(this);
    }

    @Override
    public void setState(PlayerState playerState) {
        mState = playerState;
    }

    @Override
    public void play() {
        System.out.println("play video");
    }

    @Override
    public void pause() {
        System.out.println("pause video");
    }

    @Override
    public void stop() {
        System.out.println("stop video");
    }

    @Override
    public void request(int action) {
        System.out.println("before action:" + mState.toString());
        mState.handle(action);
        System.out.println("after action:" + mState.toString());
    }
}
